FILE(GLOB TESTS ${CMAKE_CURRENT_SOURCE_DIR}/*.scdl)

FOREACH(FILENAME ${TESTS})
        GET_FILENAME_COMPONENT(TESTNAME ${FILENAME} NAME_WE)
        ADD_TEST(NAME unit-test-${TESTNAME}
                 COMMAND ${CMAKE_COMMAND}
                 -DTEST_PROG=$<TARGET_FILE:scdl-compiler>
                 -DSOURCEDIR=${CMAKE_CURRENT_SOURCE_DIR}
                 -DTESTNAME=${TESTNAME}
                 -P ${CMAKE_CURRENT_SOURCE_DIR}/runtest.txt)
ENDFOREACH()
